import React, { Component } from "react";
import { Route,Switch} from "react-router-dom";
import About from "./pages/About";
import Home from "./pages/Home";
import Header from "./components/Header";
import MyNav from "./components/MyNav";
import Test from "./components/Test";
export default class App extends Component {
  render() {
    return (
      <div>
        <Header />
        <div className="row">
          <div className="col-xs-2 col-xs-offset-2">
            <div className="list-group">
              {/* Link 导航 */}
              {/* <Link
                className="list-group-item"
                to="/about"
              >
                About
              </Link>
              <Link
                className="list-group-item"
                to="/home"
              >
                Home
              </Link> */}


              {/* NavLink 带高亮的导航 */}
               {/* <NavLink
                activeClassName="activeComp"
                className="list-group-item"
                to="/about"
              >
                About
              </NavLink> 
               <NavLink
                activeClassName="activeComp"
                className="list-group-item"
                to="/home"
              >
                Home
              </NavLink>  */}

              {/* 自己封装的nav组件，传入不同的内容就行，不需要所有所有的相同的类名属性都传 */}
              <MyNav to="/home" children="Home" />
              <MyNav to="/at/about" children="About" />

            </div>
          </div>
          <div className="col-xs-6">
            <div className="panel">
              <div className="panel-body">
                <Switch>
                  <Route path="/at/about" component={About} />
                  <Route path="/home" component={Home} />
                  <Route path="/home" component={Test} />
                </Switch>
              </div>
            </div>
          </div>
        </div>
      </div>
    );
  }
}
